;http://forums.bistudio.com/showthread.php?22554

; Script Name : groupeject.sqs
; Script Author : Lusty Pooh OFP Editing Center http://ofpediting.com
; Script Description :
;   This script will cause all of the units in a specified group to eject from a
;   specified vehicle (helicopter).  Before using this make sure that the group is
;   already in the vehicle :)
;
; Script Invokation :
;   To execute this script you use the following format :
;     [groupid,vehicleid] exec "groupeject.sqs"
;
;   where :
;      groupid : This is the id of the group that you get when you do a group this in one
;      of the group's vehicle Initialization fields.
;      vehiclename is the value of the name field (including quotes) for vehicle you want 
;      to have the group eject from
;
; Example :
;    [mygroup,heli1] exec "groupeject.sqs"


; Get the script arguments from the _this variable
_grp = _this select 0
_vehicle = _this select 1

_aunits = units _grp
_i = 0
_j = count _aunits

#Here
(_aunits select _i) action ["EJECT",_vehicle]

unassignvehicle (_aunits select _i)

_i=_i+1
~1
?_j>_i:goto "Here"

exit
